<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:79:"/www/wwwroot/crm.liunuo.net/public/../application/user/view/customer/edit.phtml";i:1552999926;s:60:"/www/wwwroot/crm.liunuo.net/application/user/view/base.phtml";i:1552999924;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('website.site_name')?></title>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/fonts.css">
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo"><img src="/static/user/images/logo.png" class="head-logo"></div>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 网站首页</a></li>
            <?php $remind_sum= today_remind_sum();?>
            <li class="layui-nav-item" style="text-align: right;"><a href="/user/customer/remind/"><i class="fa fa-bell"></i> 提醒消息 <span class="layui-badge"><?php echo $remind_sum['count']; ?></span></a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php if(session('user_auth.realname')): ?><?php echo session('user_auth.realname'); else: ?><?php echo session('user_auth.username'); endif; ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('user/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('user/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('user/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 系统首页</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<div class="layui-card">
    <div class="layui-card-header">新增客户</div>
    <div class="layui-card-body">
        <form action="<?php echo request()->url(); ?>" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">客户名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="cname" value="<?php echo (isset($data['cname']) && ($data['cname'] !== '')?$data['cname']:''); ?>" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">客户名称:公司/个人</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">客户电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="mobile" value="<?php echo (isset($data['mobile']) && ($data['mobile'] !== '')?$data['mobile']:''); ?>" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">客户电话，不可重复</div>
            </div>
            <?php if(is_array($config) || $config instanceof \think\Collection || $config instanceof \think\Paginator): if( count($config)==0 ) : echo "" ;else: foreach($config as $key=>$config): ?>
            <div class="layui-form-item">
                <label class="layui-form-label"><?php echo $config['title']; ?></label>
                <div class="layui-input-inline">
                    <?php if($config['type'] == 'input'): ?>
                    <input type="text" name="<?php echo $config['name']; ?>" value="<?php if(isset($data['jdata'][$config['name']])): ?><?php echo $data['jdata'][$config['name']]; else: ?><?php echo (isset($config['value']) && ($config['value'] !== '')?$config['value']:''); endif; ?>" placeholder="请输入<?php echo $config['title']; ?>" class="layui-input">
                    <?php endif; if($config['type'] == 'textarea'): ?>
                    <textarea name="<?php echo $config['name']; ?>" placeholder="请输入<?php echo $config['title']; ?>" class="layui-textarea"><?php if(isset($data['jdata'][$config['name']])): ?><?php echo $data['jdata'][$config['name']]; else: ?><?php echo (isset($config['value']) && ($config['value'] !== '')?$config['value']:''); endif; ?></textarea>
                    <?php endif; if($config['type'] == 'select'): if($config['is_sys'] == '1'): ?>
                    <select name="<?php echo $config['name']; ?>">
                        <?php $_5c947caa7a904=parse_attr($config['options']); if(is_array($_5c947caa7a904) || $_5c947caa7a904 instanceof \think\Collection || $_5c947caa7a904 instanceof \think\Paginator): if( count($_5c947caa7a904)==0 ) : echo "" ;else: foreach($_5c947caa7a904 as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if($data[$config['name']] == $i): ?>selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <?php else: ?>
                    <select name="<?php echo $config['name']; ?>">
                        <?php $_5c947caa7a8a7=parse_attr($config['options']); if(is_array($_5c947caa7a8a7) || $_5c947caa7a8a7 instanceof \think\Collection || $_5c947caa7a8a7 instanceof \think\Paginator): if( count($_5c947caa7a8a7)==0 ) : echo "" ;else: foreach($_5c947caa7a8a7 as $i=>$j): ?>
                        <option value="<?php echo $i; ?>" <?php if(isset($data['jdata'][$config['name']]) == $i): ?>selected="selected"<?php endif; ?>><?php echo $j; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                    <?php endif; endif; if($config['type'] == 'radio'): $_5c947caa7a838=parse_attr($config['options']); if(is_array($_5c947caa7a838) || $_5c947caa7a838 instanceof \think\Collection || $_5c947caa7a838 instanceof \think\Paginator): if( count($_5c947caa7a838)==0 ) : echo "" ;else: foreach($_5c947caa7a838 as $i=>$j): ?>
                    <input type="radio" name="<?php echo $config['name']; ?>" value="<?php echo $i; ?>" title="<?php echo $j; ?>" <?php if(isset($data['jdata'][$config['name']]) == $i): ?>checked="checked"<?php endif; ?>>
                    <?php endforeach; endif; else: echo "" ;endif; endif; if($config['type'] == 'image'): ?>
                    <input type="text" name="<?php echo $config['name']; ?>" value="<?php if(isset($data['jdata'][$config['name']])): ?><?php echo $data['jdata'][$config['name']]; else: ?><?php echo (isset($config['value']) && ($config['value'] !== '')?$config['value']:''); endif; ?>" autocomplete="off" placeholder="请上传<?php echo $config['title']; ?>" class="layui-input" style="width:200px;">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-position ajax-images"><i class="fa fa-file-image-o"></i> 选择图片</button>
                    <?php endif; ?>
                </div>
                <?php if($config['is_sys'] == '1'): ?>
                <div class="layui-form-mid layui-word-aux"><a class="layui-btn layui-btn-xs" href="<?php echo url('user/config/index'); ?>">设置参数值</a></div>
                <?php endif; ?>
            </div>
            <?php endforeach; endif; else: echo "" ;endif; ?>
            
            
            <div class="layui-form-item">
                <label class="layui-form-label">选择地区</label>
                <div class="layui-input-inline">
                        <select name="province" lay-filter="province">
                                <option></option>
                        </select>
                </div>
                <div class="layui-input-inline">
                        <select name="city" lay-filter="city">
                                <option></option>
                        </select>
                </div>
                <div class="layui-input-inline">
                        <select name="area" lay-filter="area">
                                <option></option>
                        </select>
                </div>
                
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细地址</label>
                <div class="layui-input-inline">
                    <input type="text" name="address" value="<?php echo (isset($data['address']) && ($data['address'] !== '')?$data['address']:''); ?>" autocomplete="off" class="layui-input" style="width:450px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注信息</label>
                <div class="layui-input-block">
                    <textarea name="remark" class="layui-textarea"><?php echo (isset($data['remark']) && ($data['remark'] !== '')?$data['remark']:''); ?></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>



    </div>
</div>

<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/layui.base.js"></script>
<script src="/static/js/multiSelect.js"></script>
<script src="/static/js/common.js"></script>

<script src="/static/city-picker/layui-v1.0.4/layui/lay/dest/layui.all.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/city-picker/js/citys.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
        pca.init('select[name=province]', 'select[name=city]', 'select[name=area]', '<?php echo $data['province']; ?>', '<?php echo $data['city']; ?>', '<?php echo $data['area']; ?>');
</script>

<?php if($remind_sum['web'] > '0'): ?>
<script type="text/javascript">
    layer.msg('今日您有 <?php echo $remind_sum['count']; ?> 条信息待处理', {
            offset:'t',
            time: 5000, //不自动关闭
            btn: ['立即处理', '稍后处理'],
            yes: function(index){
                layer.close(index);
                window.location.href='/user/customer/remind/';
            }
        }
    );
</script>
<?php endif; ?>
</body>
</html>